﻿using System.Windows;
using System;

namespace Geometry
{
    public static class Extensions
    {
        public static Vector ToUnit(this Vector v)
        {
            var h2 = v.X * v.X + v.Y * v.Y; 
            var h = Math.Sqrt(h2);
            return new Vector()
            {
                X = v.X / h,
                Y = v.Y / h
            };
        }
    }
}
